<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
{% extends "learning_logs/base.html" %}
{% block content %}
    {#    topic和entries都是包含在views.py所定义的字典里的#}
    <p>Topic: {{ topic }}</p>
    <p>Entries:</p>
    <p>
        <a href="{% url 'learning_logs:new_entry' topic.id %}">Add new entry</a>
    </p>
    <ul>
        {% for entry in entries %}
            <li>
                {#            | 为模板过滤器#}
                <p>{{ entry.date_added|date:'M d,Y H:i' }}</p>
                <p>{{ entry.text|linebreaks }}</p>
                <p>
                    <a href="{% url 'learning_logs:edit_entry' entry.id %}">Edit entry</a>
                </p>
            </li>
        {% empty %}
            <li>There are no entries for this topic yet.</li>
        {% endfor %}
    </ul>
{% endblock content %}

</body>
</html>